<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('人员签到打卡记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <input type="text" name="placeName" placeholder="核酸点"/>
                            </li>
                            <li>
                                <input type="text" name="teamName" placeholder="队伍"/>
                            </li>
                            <li>
                                <input type="text" name="userName" placeholder="人员"/>
                            </li>
                            <li>
                                <select name="signinType" th:with="type=${@dict.getType('fym_signin_type')}">
                                    <option value='' disabled selected style='display:none;'>场次</option>  
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]" />
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]" />
                            </li>
                            <li>
                                <select name="signinStatus" th:with="type=${@dict.getType('sys_common_status')}">
                                    <option value='' disabled selected style='display:none;'>打卡状态</option>  
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel} eq '成功'"></option>
                                </select>
                            </li>
                            <!-- <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li> -->
                            <div class="btn-group-sm" id="toolbar2" role="group">
                            	<a class="btn btn-outline btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;精准搜索</a>
				                <!-- <a class="btn btn-outline btn-success btn-sm " onclick="$.operate.add()" shiro:hasPermission="fym:signin:add">
				                    <i class="fa fa-plus"></i> 精准添加
				                </a>
				                <a class="btn btn-white btn-sm multiple disabled" onclick="$.operate.edit()" shiro:hasPermission="fym:signin:edit">
				                    <i class="fa fa-edit"></i> 修改
				                </a> -->
				                <a class="btn btn-white btn-sm multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="fym:signin:remove">
				                    <i class="fa fa-remove"></i> 批量删除
				                </a>
				                <!-- <a class="btn btn-link btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="fym:signin:export">
				                    <i class="fa fa-upload"></i> 导入
				                </a> -->
				                <a class="btn btn-link btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="fym:signin:export">
				                    <i class="fa fa-download"></i> 导出
				                </a>
				            </div>
                        </ul>
                    </div>
                </form>
            </div>

            <!-- <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="fym:signin:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="fym:signin:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="fym:signin:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="fym:signin:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div> -->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('fym:signin:edit')}]];
        var removeFlag = [[${@permission.hasPermi('fym:signin:remove')}]];
        var signinTypeDatas = [[${@dict.getType('fym_signin_type')}]];
        var signinStatusDatas = [[${@dict.getType('sys_common_status')}]];
        var delFlagDatas = [[${@dict.getType('sys_del_flag')}]];
        var prefix = ctx + "fym/signin";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "人员签到打卡记录",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                
                {
                    field: 'placeName',
                    title: '核酸点'
                },
                
                {
                    field: 'teamName',
                    title: '队伍'
                },
                
                {
                    field: 'userName',
                    title: '人员'
                },
                {
                    field: 'signinType',
                    title: '签到场次',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(signinTypeDatas, value);
                    }
                },
                {
                    field: 'signinLng',
                    title: '经度'
                },
                {
                    field: 'signinLat',
                    title: '纬度'
                },
                {
                    field: 'signinLngSjy',
                    title: '经度-设计院'
                },
                {
                    field: 'signinLatSjy',
                    title: '纬度-设计院'
                },
                {
                    field: 'createTime',
                    title: '打卡时间'
                },
                {
                    field: 'signinStatus',
                    title: '打卡状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(signinStatusDatas, value);
                    }
                },
                {
                    field: 'remark',
                    width: '200px',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-link btn-xs blue' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-link btn-xs red' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>